﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TDefragWpf.Properties;

namespace TDefrag.Lib.Helper
{
    class SystemErrorCodes
    {
        #region Error Codes

        public static Int32 ERROR_ACCESS_DENIED = 5;
        public static Int32 ERROR_ADAP_HDW_ERR = 57;
        public static Int32 ERROR_ALREADY_ASSIGNED = 85;
        public static Int32 ERROR_ALREADY_EXISTS = 183;
        public static Int32 ERROR_ARENA_TRASHED = 7;
        public static Int32 ERROR_ATOMIC_LOCKS_NOT_SUPPORTED = 174;
        public static Int32 ERROR_AUTODATASEG_EXCEEDS_64k = 199;
        public static Int32 ERROR_BAD_ARGUMENTS = 160;
        public static Int32 ERROR_BAD_COMMAND = 22;
        public static Int32 ERROR_BAD_DEV_TYPE = 66;
        public static Int32 ERROR_BAD_DRIVER_LEVEL = 119;
        public static Int32 ERROR_BAD_ENVIRONMENT = 10;
        public static Int32 ERROR_BAD_EXE_FORMAT = 193;
        public static Int32 ERROR_BAD_FILE_TYPE = 222;
        public static Int32 ERROR_BAD_FORMAT = 11;
        public static Int32 ERROR_BAD_LENGTH = 24;
        public static Int32 ERROR_BAD_NET_NAME = 67;
        public static Int32 ERROR_BAD_NET_RESP = 58;
        public static Int32 ERROR_BAD_NETPATH = 53;
        public static Int32 ERROR_BAD_PATHNAME = 161;
        public static Int32 ERROR_BAD_PIPE = 230;
        public static Int32 ERROR_BAD_REM_ADAP = 60;
        public static Int32 ERROR_BAD_THREADID_ADDR = 159;
        public static Int32 ERROR_BAD_UNIT = 20;
        public static Int32 ERROR_BROKEN_PIPE = 109;
        public static Int32 ERROR_BUFFER_OVERFLOW = 111;
        public static Int32 ERROR_BUSY_DRIVE = 142;
        public static Int32 ERROR_BUSY = 170;
        public static Int32 ERROR_CALL_NOT_IMPLEMENTED = 120;
        public static Int32 ERROR_CANCEL_VIOLATION = 173;
        public static Int32 ERROR_CANNOT_COPY = 266;
        public static Int32 ERROR_CANNOT_MAKE = 82;
        public static Int32 ERROR_CHECKOUT_REQUIRED = 221;
        public static Int32 ERROR_CHILD_NOT_COMPLETE = 129;
        public static Int32 ERROR_CRC = 23;
        public static Int32 ERROR_CURRENT_DIRECTORY = 16;
        public static Int32 ERROR_DELETE_PENDING = 303;
        public static Int32 ERROR_DEV_NOT_EXIST = 55;
        public static Int32 ERROR_DIR_NOT_EMPTY = 145;
        public static Int32 ERROR_DIR_NOT_ROOT = 144;
        public static Int32 ERROR_DIRECT_ACCESS_HANDLE = 130;
        public static Int32 ERROR_DIRECTORY = 267;
        public static Int32 ERROR_DISCARDED = 157;
        public static Int32 ERROR_DISK_CHANGE = 107;
        public static Int32 ERROR_DISK_FULL = 112;
        public static Int32 ERROR_DISK_TOO_FRAGMENTED = 302;
        public static Int32 ERROR_DRIVE_LOCKED = 108;
        public static Int32 ERROR_DUP_NAME = 52;
        public static Int32 ERROR_DYNLINK_FROM_INVALID_RING = 196;
        public static Int32 ERROR_EA_FILE_CORRUPT = 276;
        public static Int32 ERROR_EA_LIST_INCONSISTENT = 255;
        public static Int32 ERROR_EA_TABLE_FULL = 277;
        public static Int32 ERROR_EAS_DIDNT_FIT = 275;
        public static Int32 ERROR_EAS_NOT_SUPPORTED = 282;
        public static Int32 ERROR_ENVVAR_NOT_FOUND = 203;
        public static Int32 ERROR_EXCL_SEM_ALREADY_OWNED = 101;
        public static Int32 ERROR_EXE_CANNOT_MODIFY_SIGNED_BINARY = 217;
        public static Int32 ERROR_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY = 218;
        public static Int32 ERROR_EXE_MACHINE_TYPE_MISMATCH = 216;
        public static Int32 ERROR_EXE_MARKED_INVALID = 192;
        public static Int32 ERROR_FAIL_I24 = 83;
        public static Int32 ERROR_FAIL_NOACTION_REBOOT = 350;
        public static Int32 ERROR_FAIL_RESTART = 352;
        public static Int32 ERROR_FAIL_SHUTDOWN = 351;
        public static Int32 ERROR_FILE_CHECKED_OUT = 220;
        public static Int32 ERROR_FILE_EXISTS = 80;
        public static Int32 ERROR_FILE_NOT_FOUND = 2;
        public static Int32 ERROR_FILE_TOO_LARGE = 223;
        public static Int32 ERROR_FILENAME_EXCED_RANGE = 206;
        public static Int32 ERROR_FORMS_AUTH_REQUIRED = 224;
        public static Int32 ERROR_GEN_FAILURE = 31;
        public static Int32 ERROR_HANDLE_DISK_FULL = 39;
        public static Int32 ERROR_HANDLE_EOF = 38;
        public static Int32 ERROR_IMAGE_SUBSYSTEM_NOT_PRESENT = 308;
        public static Int32 ERROR_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING = 304;
        public static Int32 ERROR_INFLOOP_IN_RELOC_CHAIN = 202;
        public static Int32 ERROR_INSUFFICIENT_BUFFER = 122;
        public static Int32 ERROR_INVALID_ACCESS = 12;
        public static Int32 ERROR_INVALID_ADDRESS = 487;
        public static Int32 ERROR_INVALID_AT_INTERRUPT_TIME = 104;
        public static Int32 ERROR_INVALID_BLOCK = 9;
        public static Int32 ERROR_INVALID_CATEGORY = 117;
        public static Int32 ERROR_INVALID_DATA = 13;
        public static Int32 ERROR_INVALID_DRIVE = 15;
        public static Int32 ERROR_INVALID_EA_HANDLE = 278;
        public static Int32 ERROR_INVALID_EA_NAME = 254;
        public static Int32 ERROR_INVALID_EVENT_COUNT = 151;
        public static Int32 ERROR_INVALID_EXE_SIGNATURE = 191;
        public static Int32 ERROR_INVALID_FLAG_NUMBER = 186;
        public static Int32 ERROR_INVALID_FUNCTION = 1;
        public static Int32 ERROR_INVALID_HANDLE = 6;
        public static Int32 ERROR_INVALID_LEVEL = 124;
        public static Int32 ERROR_INVALID_LIST_FORMAT = 153;
        public static Int32 ERROR_INVALID_LOCK_RANGE = 307;
        public static Int32 ERROR_INVALID_MINALLOCSIZE = 195;
        public static Int32 ERROR_INVALID_MODULETYPE = 190;
        public static Int32 ERROR_INVALID_NAME = 123;
        public static Int32 ERROR_INVALID_OPLOCK_PROTOCOL = 301;
        public static Int32 ERROR_INVALID_ORDINAL = 182;
        public static Int32 ERROR_INVALID_PARAMETER = 87;
        public static Int32 ERROR_INVALID_PASSWORD = 86;
        public static Int32 ERROR_INVALID_SEGDPL = 198;
        public static Int32 ERROR_INVALID_SEGMENT_NUMBER = 180;
        public static Int32 ERROR_INVALID_SIGNAL_NUMBER = 209;
        public static Int32 ERROR_INVALID_STACKSEG = 189;
        public static Int32 ERROR_INVALID_STARTING_CODESEG = 188;
        public static Int32 ERROR_INVALID_TARGET_HANDLE = 114;
        public static Int32 ERROR_INVALID_VERIFY_SWITCH = 118;
        public static Int32 ERROR_IOPL_NOT_ENABLED = 197;
        public static Int32 ERROR_IS_JOIN_PATH = 147;
        public static Int32 ERROR_IS_JOIN_TARGET = 133;
        public static Int32 ERROR_IS_JOINED = 134;
        public static Int32 ERROR_IS_SUBST_PATH = 146;
        public static Int32 ERROR_IS_SUBST_TARGET = 149;
        public static Int32 ERROR_IS_SUBSTED = 135;
        public static Int32 ERROR_ITERATED_DATA_EXCEEDS_64k = 194;
        public static Int32 ERROR_JOIN_TO_JOIN = 138;
        public static Int32 ERROR_JOIN_TO_SUBST = 140;
        public static Int32 ERROR_LABEL_TOO_LONG = 154;
        public static Int32 ERROR_LOCK_FAILED = 167;
        public static Int32 ERROR_LOCK_VIOLATION = 33;
        public static Int32 ERROR_LOCKED = 212;
        public static Int32 ERROR_MAX_SESSIONS_REACHED = 353;
        public static Int32 ERROR_MAX_THRDS_REACHED = 164;
        public static Int32 ERROR_META_EXPANSION_TOO_LONG = 208;
        public static Int32 ERROR_MOD_NOT_FOUND = 126;
        public static Int32 ERROR_MORE_DATA = 234;
        public static Int32 ERROR_MR_MID_NOT_FOUND = 317;
        public static Int32 ERROR_NEGATIVE_SEEK = 131;
        public static Int32 ERROR_NESTING_NOT_ALLOWED = 215;
        public static Int32 ERROR_NET_WRITE_FAULT = 88;
        public static Int32 ERROR_NETNAME_DELETED = 64;
        public static Int32 ERROR_NETWORK_ACCESS_DENIED = 65;
        public static Int32 ERROR_NETWORK_BUSY = 54;
        public static Int32 ERROR_NO_DATA = 232;
        public static Int32 ERROR_NO_MORE_FILES = 18;
        public static Int32 ERROR_NO_MORE_ITEMS = 259;
        public static Int32 ERROR_NO_MORE_SEARCH_HANDLES = 113;
        public static Int32 ERROR_NO_PROC_SLOTS = 89;
        public static Int32 ERROR_NO_SIGNAL_SENT = 205;
        public static Int32 ERROR_NO_SPOOL_SPACE = 62;
        public static Int32 ERROR_NO_VOLUME_LABEL = 125;
        public static Int32 ERROR_NOT_DOS_DISK = 26;
        public static Int32 ERROR_NOT_ENOUGH_MEMORY = 8;
        public static Int32 ERROR_NOT_JOINED = 136;
        public static Int32 ERROR_NOT_LOCKED = 158;
        public static Int32 ERROR_NOT_OWNER = 288;
        public static Int32 ERROR_NOT_READY = 21;
        public static Int32 ERROR_NOT_SAME_DEVICE = 17;
        public static Int32 ERROR_NOT_SUBSTED = 137;
        public static Int32 ERROR_NOT_SUPPORTED = 50;
        public static Int32 ERROR_NOTIFICATION_GUID_ALREADY_DEFINED = 309;
        public static Int32 ERROR_OPEN_FAILED = 110;
        public static Int32 ERROR_OPLOCK_NOT_GRANTED = 300;
        public static Int32 ERROR_OUT_OF_PAPER = 28;
        public static Int32 ERROR_OUT_OF_STRUCTURES = 84;
        public static Int32 ERROR_OUTOFMEMORY = 14;
        public static Int32 ERROR_PARTIAL_COPY = 299;
        public static Int32 ERROR_PATH_BUSY = 148;
        public static Int32 ERROR_PATH_NOT_FOUND = 3;
        public static Int32 ERROR_PIPE_BUSY = 231;
        public static Int32 ERROR_PIPE_LOCAL = 229;
        public static Int32 ERROR_PIPE_NOT_CONNECTED = 233;
        public static Int32 ERROR_PRINT_CANCELLED = 63;
        public static Int32 ERROR_PRINTQ_FULL = 61;
        public static Int32 ERROR_PROC_NOT_FOUND = 127;
        public static Int32 ERROR_PROCESS_MODE_ALREADY_BACKGROUND = 402;
        public static Int32 ERROR_PROCESS_MODE_NOT_BACKGROUND = 403;
        public static Int32 ERROR_READ_FAULT = 30;
        public static Int32 ERROR_REDIR_PAUSED = 72;
        public static Int32 ERROR_RELOC_CHAIN_XEEDS_SEGLIM = 201;
        public static Int32 ERROR_REM_NOT_LIST = 51;
        public static Int32 ERROR_REQ_NOT_ACCEP = 71;
        public static Int32 ERROR_RING2_STACK_IN_USE = 207;
        public static Int32 ERROR_RING2SEG_MUST_BE_MOVABLE = 200;
        public static Int32 ERROR_SAME_DRIVE = 143;
        public static Int32 ERROR_SCOPE_NOT_FOUND = 318;
        public static Int32 ERROR_SECTOR_NOT_FOUND = 27;
        public static Int32 ERROR_SECURITY_STREAM_IS_INCONSISTENT = 306;
        public static Int32 ERROR_SEEK_ON_DEVICE = 132;
        public static Int32 ERROR_SEEK = 25;
        public static Int32 ERROR_SEM_IS_SET = 102;
        public static Int32 ERROR_SEM_NOT_FOUND = 187;
        public static Int32 ERROR_SEM_OWNER_DIED = 105;
        public static Int32 ERROR_SEM_TIMEOUT = 121;
        public static Int32 ERROR_SEM_USER_LIMIT = 106;
        public static Int32 ERROR_SHARING_BUFFER_EXCEEDED = 36;
        public static Int32 ERROR_SHARING_PAUSED = 70;
        public static Int32 ERROR_SHARING_VIOLATION = 32;
        public static Int32 ERROR_SHORT_NAMES_NOT_ENABLED_ON_VOLUME = 305;
        public static Int32 ERROR_SIGNAL_PENDING = 162;
        public static Int32 ERROR_SIGNAL_REFUSED = 156;
        public static Int32 ERROR_SUBST_TO_JOIN = 141;
        public static Int32 ERROR_SUBST_TO_SUBST = 139;
        public static Int32 ERROR_SUCCESS = 0;
        public static Int32 ERROR_SYSTEM_TRACE = 150;
        public static Int32 ERROR_THREAD_1_INACTIVE = 210;
        public static Int32 ERROR_THREAD_MODE_ALREADY_BACKGROUND = 400;
        public static Int32 ERROR_THREAD_MODE_NOT_BACKGROUND = 401;
        public static Int32 ERROR_TOO_MANY_CMDS = 56;
        public static Int32 ERROR_TOO_MANY_MODULES = 214;
        public static Int32 ERROR_TOO_MANY_MUXWAITERS = 152;
        public static Int32 ERROR_TOO_MANY_NAMES = 68;
        public static Int32 ERROR_TOO_MANY_OPEN_FILES = 4;
        public static Int32 ERROR_TOO_MANY_POSTS = 298;
        public static Int32 ERROR_TOO_MANY_SEM_REQUESTS = 103;
        public static Int32 ERROR_TOO_MANY_SEMAPHORES = 100;
        public static Int32 ERROR_TOO_MANY_SESS = 69;
        public static Int32 ERROR_TOO_MANY_TCBS = 155;
        public static Int32 ERROR_UNEXP_NET_ERR = 59;
        public static Int32 ERROR_VC_DISCONNECTED = 240;
        public static Int32 ERROR_VIRUS_DELETED = 226;
        public static Int32 ERROR_VIRUS_INFECTED = 225;
        public static Int32 ERROR_WAIT_NO_CHILDREN = 128;
        public static Int32 ERROR_WRITE_FAULT = 29;
        public static Int32 ERROR_WRITE_PROTECT = 19;
        public static Int32 ERROR_WRONG_DISK = 34;
        public static Int32 WAIT_TIMEOUT = 258;

        #endregion

        public static Dictionary<Int32, String> ErrorMessages;

        private SystemErrorCodes()
        {
            ErrorMessages = new Dictionary<Int32, String>();

            #region Error Code mapping

            ErrorMessages.Add(ERROR_ACCESS_DENIED, Resources.SystemErrorAccessDenied);
            ErrorMessages.Add(ERROR_ADAP_HDW_ERR, Resources.SystemErrorAdapterHardwareError);
            ErrorMessages.Add(ERROR_ALREADY_ASSIGNED, Resources.SystemErrorAlreadyAssigned);
            ErrorMessages.Add(ERROR_ALREADY_EXISTS, Resources.SystemErrorAlreadyExists);
            ErrorMessages.Add(ERROR_ARENA_TRASHED, Resources.SystemErrorArenaThrashed);
            ErrorMessages.Add(ERROR_ATOMIC_LOCKS_NOT_SUPPORTED, Resources.SystemErrorAtomicLocksNotSupported);
            ErrorMessages.Add(ERROR_AUTODATASEG_EXCEEDS_64k, Resources.SystemErrorAutoDataSegmentExceeds64k);
            ErrorMessages.Add(ERROR_BAD_ARGUMENTS, Resources.SystemErrorBadArguments);
            ErrorMessages.Add(ERROR_BAD_COMMAND, Resources.SystemErrorBadCommand);
            ErrorMessages.Add(ERROR_BAD_DEV_TYPE, Resources.SystemErrorBadDeviceType);
            ErrorMessages.Add(ERROR_BAD_DRIVER_LEVEL, Resources.SystemErrorBadDriverLevel);
            ErrorMessages.Add(ERROR_BAD_ENVIRONMENT, Resources.SystemErrorBadEnvironment);
            ErrorMessages.Add(ERROR_BAD_EXE_FORMAT, Resources.SystemErrorBadExeFormat);
            ErrorMessages.Add(ERROR_BAD_FILE_TYPE, Resources.SystemErrorBadFileType);
            ErrorMessages.Add(ERROR_BAD_FORMAT, Resources.SystemErrorBadFormat);
            ErrorMessages.Add(ERROR_BAD_LENGTH, Resources.SystemErrorBadLength);
            ErrorMessages.Add(ERROR_BAD_NET_NAME, Resources.SystemErrorBadNetworkName);
            ErrorMessages.Add(ERROR_BAD_NET_RESP, Resources.SystemErrorBadNetworkResponse);
            ErrorMessages.Add(ERROR_BAD_NETPATH, Resources.SystemErrorBadNetworkPath);
            ErrorMessages.Add(ERROR_BAD_PATHNAME, Resources.SystemErrorBadPathName);
            ErrorMessages.Add(ERROR_BAD_PIPE, Resources.SystemErrorBadPipe);
            ErrorMessages.Add(ERROR_BAD_REM_ADAP, Resources.SystemErrorBadRemoteAdapter);
            ErrorMessages.Add(ERROR_BAD_THREADID_ADDR, Resources.SystemErrorBadThreadIdAddress);
            ErrorMessages.Add(ERROR_BAD_UNIT, Resources.SystemErrorBadUnit);
            ErrorMessages.Add(ERROR_BROKEN_PIPE, Resources.SystemErrorBrokenPipe);
            ErrorMessages.Add(ERROR_BUFFER_OVERFLOW, Resources.SystemErrorBufferOverflow);
            ErrorMessages.Add(ERROR_BUSY_DRIVE, Resources.SystemErrorBusyDrive);
            ErrorMessages.Add(ERROR_BUSY, Resources.SystemErrorBusy);
            ErrorMessages.Add(ERROR_CALL_NOT_IMPLEMENTED, Resources.SystemErrorCallNotImplemented);
            ErrorMessages.Add(ERROR_CANCEL_VIOLATION, Resources.SystemErrorCancelViolation);
            ErrorMessages.Add(ERROR_CANNOT_COPY, Resources.SystemErrorCannotCopy);
            ErrorMessages.Add(ERROR_CANNOT_MAKE, Resources.SystemErrorCannotCreate);
            ErrorMessages.Add(ERROR_CHECKOUT_REQUIRED, Resources.SystemErrorCheckoutRequired);
            ErrorMessages.Add(ERROR_CHILD_NOT_COMPLETE, Resources.SystemErrorChildNotComplete);
            ErrorMessages.Add(ERROR_CRC, Resources.SystemErrorCrc);
            ErrorMessages.Add(ERROR_CURRENT_DIRECTORY, Resources.SystemErrorCurrentDirectory);
            ErrorMessages.Add(ERROR_DELETE_PENDING, Resources.SystemErrorDeletePending);
            ErrorMessages.Add(ERROR_DEV_NOT_EXIST, Resources.SystemErrorDeviceNotExist);
            ErrorMessages.Add(ERROR_DIR_NOT_EMPTY, Resources.SystemErrorDirectoryNotEmpty);
            ErrorMessages.Add(ERROR_DIR_NOT_ROOT, Resources.SystemErrorDirectoryNotRoot);
            ErrorMessages.Add(ERROR_DIRECT_ACCESS_HANDLE, Resources.SystemErrorDirectoryAccessHandle);
            ErrorMessages.Add(ERROR_DIRECTORY, Resources.SystemErrorDirectory);
            ErrorMessages.Add(ERROR_DISCARDED, Resources.SystemErrorDiscarded);
            ErrorMessages.Add(ERROR_DISK_CHANGE, Resources.SystemErrorDiskChange);
            ErrorMessages.Add(ERROR_DISK_FULL, Resources.SystemErrorDiskFull);
            ErrorMessages.Add(ERROR_DISK_TOO_FRAGMENTED, Resources.SystemErrorDiskTooFragmented);
            ErrorMessages.Add(ERROR_DRIVE_LOCKED, Resources.SystemErrorDriveLocked);
            ErrorMessages.Add(ERROR_DUP_NAME, Resources.SystemErrorDuplicateName);
            ErrorMessages.Add(ERROR_DYNLINK_FROM_INVALID_RING, Resources.SystemErrorDynamicLinkFromInvalidRing);
            ErrorMessages.Add(ERROR_EA_FILE_CORRUPT, Resources.SystemErrorEaFileCorrupt);
            ErrorMessages.Add(ERROR_EA_LIST_INCONSISTENT, Resources.SystemErrorEaListInconsistent);
            ErrorMessages.Add(ERROR_EA_TABLE_FULL, Resources.SystemErrorEaTableFull);
            ErrorMessages.Add(ERROR_EAS_DIDNT_FIT, Resources.SystemErrorEasDidNotFit);
            ErrorMessages.Add(ERROR_EAS_NOT_SUPPORTED, Resources.SystemErrorEasNotSupported);
            ErrorMessages.Add(ERROR_ENVVAR_NOT_FOUND, Resources.SystemErrorEnvVarNotFound);
            ErrorMessages.Add(ERROR_EXCL_SEM_ALREADY_OWNED, Resources.SystemErrorExclusiveSemaphoreAlreadyOwned);
            ErrorMessages.Add(ERROR_EXE_CANNOT_MODIFY_SIGNED_BINARY, Resources.SystemErrorExeCanNotModifySignedBinary);
            ErrorMessages.Add(ERROR_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY, Resources.SystemErrorExeCanNotModifyStrongSingedBinary);
            ErrorMessages.Add(ERROR_EXE_MACHINE_TYPE_MISMATCH, Resources.SystemErrorExeMachineTypeMismatch);
            ErrorMessages.Add(ERROR_EXE_MARKED_INVALID, Resources.SystemErrorExeMarkedInvalid);
            ErrorMessages.Add(ERROR_FAIL_I24, Resources.SystemErrorFailInt24);
            ErrorMessages.Add(ERROR_FAIL_NOACTION_REBOOT, Resources.SystemErrorFailNoActionReboot);
            ErrorMessages.Add(ERROR_FAIL_RESTART, Resources.SystemErrorFailRestart);
            ErrorMessages.Add(ERROR_FAIL_SHUTDOWN, Resources.SystemErrorFailShutdown);
            ErrorMessages.Add(ERROR_FILE_CHECKED_OUT, Resources.SystemErrorFileCheckedOut);
            ErrorMessages.Add(ERROR_FILE_EXISTS, Resources.SystemErrorFileExists);
            ErrorMessages.Add(ERROR_FILE_NOT_FOUND, Resources.SystemErrorFileNotFound);
            ErrorMessages.Add(ERROR_FILE_TOO_LARGE, Resources.SystemErrorFileTooLarge);
            ErrorMessages.Add(ERROR_FILENAME_EXCED_RANGE, Resources.SystemErrorFileNameExceedsRange);
            ErrorMessages.Add(ERROR_FORMS_AUTH_REQUIRED, Resources.SystemErrorFormsAuthenticationRequired);
            ErrorMessages.Add(ERROR_GEN_FAILURE, Resources.SystemErrorGeneralFailure);
            ErrorMessages.Add(ERROR_HANDLE_DISK_FULL, Resources.SystemErrorHandleDiskFull);
            ErrorMessages.Add(ERROR_HANDLE_EOF, Resources.SystemErrorHandleEof);
            ErrorMessages.Add(ERROR_IMAGE_SUBSYSTEM_NOT_PRESENT, Resources.SystemErrorImageSubsystemNotPresent);
            ErrorMessages.Add(ERROR_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING, Resources.SystemErrorIncompatibleWithGlobalShortNameRegistrySetting);
            ErrorMessages.Add(ERROR_INFLOOP_IN_RELOC_CHAIN, Resources.SystemErrorInfiniteLoopInRelocationChain);
            ErrorMessages.Add(ERROR_INSUFFICIENT_BUFFER, Resources.SystemErrorInsufficientBuffer);
            ErrorMessages.Add(ERROR_INVALID_ACCESS, Resources.SystemErrorInvalidAccess);
            ErrorMessages.Add(ERROR_INVALID_ADDRESS, Resources.SystemErrorInvalidAddress);
            ErrorMessages.Add(ERROR_INVALID_AT_INTERRUPT_TIME, Resources.SystemErrorInvalidAtInterruptTime);
            ErrorMessages.Add(ERROR_INVALID_BLOCK, Resources.SystemErrorInvalidBlock);
            ErrorMessages.Add(ERROR_INVALID_CATEGORY, Resources.SystemErrorInvalidCategory);
            ErrorMessages.Add(ERROR_INVALID_DATA, Resources.SystemErrorInvalidData);
            ErrorMessages.Add(ERROR_INVALID_DRIVE, Resources.SystemErrorInvalidDrive);
            ErrorMessages.Add(ERROR_INVALID_EA_HANDLE, Resources.SystemErrorInvalidEaHandle);
            ErrorMessages.Add(ERROR_INVALID_EA_NAME, Resources.SystemErrorInvalidEaName);
            ErrorMessages.Add(ERROR_INVALID_EVENT_COUNT, Resources.SystemErrorInvalidEventCount);
            ErrorMessages.Add(ERROR_INVALID_EXE_SIGNATURE, Resources.SystemErrorInvalidExeSignature);
            ErrorMessages.Add(ERROR_INVALID_FLAG_NUMBER, Resources.SystemErrorInvalidFlagNumber);
            ErrorMessages.Add(ERROR_INVALID_FUNCTION, Resources.SystemErrorInvalidFunction);
            ErrorMessages.Add(ERROR_INVALID_HANDLE, Resources.SystemErrorInvalidHandle);
            ErrorMessages.Add(ERROR_INVALID_LEVEL, Resources.SystemErrorInvalidLevel);
            ErrorMessages.Add(ERROR_INVALID_LIST_FORMAT, Resources.SystemErrorInvalidListFormat);
            ErrorMessages.Add(ERROR_INVALID_LOCK_RANGE, Resources.SystemErrorInvalidLockRange);
            ErrorMessages.Add(ERROR_INVALID_MINALLOCSIZE, Resources.SystemErrorInvalidMinimumAllocationSize);
            ErrorMessages.Add(ERROR_INVALID_MODULETYPE, Resources.SystemErrorInvalidModuleType);
            ErrorMessages.Add(ERROR_INVALID_NAME, Resources.SystemErrorInvalidName);
            ErrorMessages.Add(ERROR_INVALID_OPLOCK_PROTOCOL, Resources.SystemErrorInvalidOplockProtocol);
            ErrorMessages.Add(ERROR_INVALID_ORDINAL, Resources.SystemErrorInvalidOrdinal);
            ErrorMessages.Add(ERROR_INVALID_PARAMETER, Resources.SystemErrorInvalidParameter);
            ErrorMessages.Add(ERROR_INVALID_PASSWORD, Resources.SystemErrorInvalidPassword);
            ErrorMessages.Add(ERROR_INVALID_SEGDPL, Resources.SystemErrorInvalidSegmentDeployment);
            ErrorMessages.Add(ERROR_INVALID_SEGMENT_NUMBER, Resources.SystemErrorInvalidSegmentNumber);
            ErrorMessages.Add(ERROR_INVALID_SIGNAL_NUMBER, Resources.SystemErrorInvalidSignalNumber);
            ErrorMessages.Add(ERROR_INVALID_STACKSEG, Resources.SystemErrorInvalidStackSegment);
            ErrorMessages.Add(ERROR_INVALID_STARTING_CODESEG, Resources.SystemErrorInvalidStartingCodeSegment);
            ErrorMessages.Add(ERROR_INVALID_TARGET_HANDLE, Resources.SystemErrorInvalidTargetHandle);
            ErrorMessages.Add(ERROR_INVALID_VERIFY_SWITCH, Resources.SystemErrorInvalidVerifySwitch);
            ErrorMessages.Add(ERROR_IOPL_NOT_ENABLED, Resources.SystemErrorIoplNotEnabled);
            ErrorMessages.Add(ERROR_IS_JOIN_PATH, Resources.SystemErrorIsJoinPath);
            ErrorMessages.Add(ERROR_IS_JOIN_TARGET, Resources.SystemErrorIsJoinTarget);
            ErrorMessages.Add(ERROR_IS_JOINED, Resources.SystemErrorIsJoined);
            ErrorMessages.Add(ERROR_IS_SUBST_PATH, Resources.SystemErrorIsSubstPath);
            ErrorMessages.Add(ERROR_IS_SUBST_TARGET, Resources.SystemErrorIsSubstTarget);
            ErrorMessages.Add(ERROR_IS_SUBSTED, Resources.SystemErrorIsSubsted);
            ErrorMessages.Add(ERROR_ITERATED_DATA_EXCEEDS_64k, Resources.SystemErrorIteratedDataExceeds64k);
            ErrorMessages.Add(ERROR_JOIN_TO_JOIN, Resources.SystemErrorJoinToJoin);
            ErrorMessages.Add(ERROR_JOIN_TO_SUBST, Resources.SystemErrorJoinToSubst);
            ErrorMessages.Add(ERROR_LABEL_TOO_LONG, Resources.SystemErrorLabelTooLong);
            ErrorMessages.Add(ERROR_LOCK_FAILED, Resources.SystemErrorLockFailed);
            ErrorMessages.Add(ERROR_LOCK_VIOLATION, Resources.SystemErrorLockViolation);
            ErrorMessages.Add(ERROR_LOCKED, Resources.SystemErrorLocked);
            ErrorMessages.Add(ERROR_MAX_SESSIONS_REACHED, Resources.SystemErrorMaxSessionsReached);
            ErrorMessages.Add(ERROR_MAX_THRDS_REACHED, Resources.SystemErrorMaxThreadsReached);
            ErrorMessages.Add(ERROR_META_EXPANSION_TOO_LONG, Resources.SystemErrorMetaExpansionTooLong);
            ErrorMessages.Add(ERROR_MOD_NOT_FOUND, Resources.SystemErrorModuleNotFound);
            ErrorMessages.Add(ERROR_MORE_DATA, Resources.SystemErrorMoreData);
            ErrorMessages.Add(ERROR_MR_MID_NOT_FOUND, Resources.SystemErrorMrMidNotFound);
            ErrorMessages.Add(ERROR_NEGATIVE_SEEK, Resources.SystemErrorNegativeSeek);
            ErrorMessages.Add(ERROR_NESTING_NOT_ALLOWED, Resources.SystemErrorNestingNotAllowed);
            ErrorMessages.Add(ERROR_NET_WRITE_FAULT, Resources.SystemErrorNetworkWriteFault);
            ErrorMessages.Add(ERROR_NETNAME_DELETED, Resources.SystemErrorNetworkNameDeleted);
            ErrorMessages.Add(ERROR_NETWORK_ACCESS_DENIED, Resources.SystemErrorNetworkAccessDenied);
            ErrorMessages.Add(ERROR_NETWORK_BUSY, Resources.SystemErrorNetworkBusy);
            ErrorMessages.Add(ERROR_NO_DATA, Resources.SystemErrorNoData);
            ErrorMessages.Add(ERROR_NO_MORE_FILES, Resources.SystemErrorNoMoreFiles);
            ErrorMessages.Add(ERROR_NO_MORE_ITEMS, Resources.SystemErrorNoMoreItems);
            ErrorMessages.Add(ERROR_NO_MORE_SEARCH_HANDLES, Resources.SystemErrorNoMoreSearchHandles);
            ErrorMessages.Add(ERROR_NO_PROC_SLOTS, Resources.SystemErrorNoMoreProcessSlots);
            ErrorMessages.Add(ERROR_NO_SIGNAL_SENT, Resources.SystemErrorNoSignalSent);
            ErrorMessages.Add(ERROR_NO_SPOOL_SPACE, Resources.SystemErrorNoSpoolSpace);
            ErrorMessages.Add(ERROR_NO_VOLUME_LABEL, Resources.SystemErrorNoVolumeLabel);
            ErrorMessages.Add(ERROR_NOT_DOS_DISK, Resources.SystemErrorNotDosDisk);
            ErrorMessages.Add(ERROR_NOT_ENOUGH_MEMORY, Resources.SystemErrorNotEnoughMemory);
            ErrorMessages.Add(ERROR_NOT_JOINED, Resources.SystemErrorNotJoined);
            ErrorMessages.Add(ERROR_NOT_LOCKED, Resources.SystemErrorNotLocked);
            ErrorMessages.Add(ERROR_NOT_OWNER, Resources.SystemErrorNotOwner);
            ErrorMessages.Add(ERROR_NOT_READY, Resources.SystemErrorNotReady);
            ErrorMessages.Add(ERROR_NOT_SAME_DEVICE, Resources.SystemErrorNotSameDevice);
            ErrorMessages.Add(ERROR_NOT_SUBSTED, Resources.SystemErrorNotSubsted);
            ErrorMessages.Add(ERROR_NOT_SUPPORTED, Resources.SystemErrorNotSupported);
            ErrorMessages.Add(ERROR_NOTIFICATION_GUID_ALREADY_DEFINED, Resources.SystemErrorNotificationGuidAlreadyDefined);
            ErrorMessages.Add(ERROR_OPEN_FAILED, Resources.SystemErrorOpenFailed);
            ErrorMessages.Add(ERROR_OPLOCK_NOT_GRANTED, Resources.SystemErrorOplockNotGranted);
            ErrorMessages.Add(ERROR_OUT_OF_PAPER, Resources.SystemErrorOutOfPaper);
            ErrorMessages.Add(ERROR_OUT_OF_STRUCTURES, Resources.SystemErrorOutOfStructures);
            ErrorMessages.Add(ERROR_OUTOFMEMORY, Resources.SystemErrorOutOfMemory);
            ErrorMessages.Add(ERROR_PARTIAL_COPY, Resources.SystemErrorPartialCopy);
            ErrorMessages.Add(ERROR_PATH_BUSY, Resources.SystemErrorPathBusy);
            ErrorMessages.Add(ERROR_PATH_NOT_FOUND, Resources.SystemErrorPathNotFound);
            ErrorMessages.Add(ERROR_PIPE_BUSY, Resources.SystemErrorPipeBusy);
            ErrorMessages.Add(ERROR_PIPE_LOCAL, Resources.SystemErrorPipeLocal);
            ErrorMessages.Add(ERROR_PIPE_NOT_CONNECTED, Resources.SystemErrorPipeNotConnected);
            ErrorMessages.Add(ERROR_PRINT_CANCELLED, Resources.SystemErrorPrintCancelled);
            ErrorMessages.Add(ERROR_PRINTQ_FULL, Resources.SystemErrorPrintQueueFull);
            ErrorMessages.Add(ERROR_PROC_NOT_FOUND, Resources.SystemErrorProcedureNotFound);
            ErrorMessages.Add(ERROR_PROCESS_MODE_ALREADY_BACKGROUND, Resources.SystemErrorProcessModeAlreadyBackground);
            ErrorMessages.Add(ERROR_PROCESS_MODE_NOT_BACKGROUND, Resources.SystemErrorProcessModeNotBackground);
            ErrorMessages.Add(ERROR_READ_FAULT, Resources.SystemErrorReadFault);
            ErrorMessages.Add(ERROR_REDIR_PAUSED, Resources.SystemErrorRedirectingPaused);
            ErrorMessages.Add(ERROR_RELOC_CHAIN_XEEDS_SEGLIM, Resources.SystemErrorRelocationChainExceedsSegmentLimit);
            ErrorMessages.Add(ERROR_REM_NOT_LIST, Resources.SystemErrorNetworkPathNotFound);
            ErrorMessages.Add(ERROR_REQ_NOT_ACCEP, Resources.SystemErrorRequestNotAccepted);
            ErrorMessages.Add(ERROR_RING2_STACK_IN_USE, Resources.SystemErrorRing2StackInUse);
            ErrorMessages.Add(ERROR_RING2SEG_MUST_BE_MOVABLE, Resources.SystemErrorRing2SegmentMustBeMovable);
            ErrorMessages.Add(ERROR_SAME_DRIVE, Resources.SystemErrorSameDrive);
            ErrorMessages.Add(ERROR_SCOPE_NOT_FOUND, Resources.SystemErrorScopeNotFound);
            ErrorMessages.Add(ERROR_SECTOR_NOT_FOUND, Resources.SystemErrorSectorNotFound);
            ErrorMessages.Add(ERROR_SECURITY_STREAM_IS_INCONSISTENT, Resources.SystemErrorSecurityStreamIsInconsistent);
            ErrorMessages.Add(ERROR_SEEK_ON_DEVICE, Resources.SystemErrorSeekOnDevice);
            ErrorMessages.Add(ERROR_SEEK, Resources.SystemErrorSeek);
            ErrorMessages.Add(ERROR_SEM_IS_SET, Resources.SystemErrorSemaphoreIsSet);
            ErrorMessages.Add(ERROR_SEM_NOT_FOUND, Resources.SystemErrorSemaphoreNotFound);
            ErrorMessages.Add(ERROR_SEM_OWNER_DIED, Resources.SystemErrorSemaphoreOwnerDied);
            ErrorMessages.Add(ERROR_SEM_TIMEOUT, Resources.SystemErrorSemaphoreTimeout);
            ErrorMessages.Add(ERROR_SEM_USER_LIMIT, Resources.SystemErrorSemaphoreUserLimit);
            ErrorMessages.Add(ERROR_SHARING_BUFFER_EXCEEDED, Resources.SystemErrorSharingBufferExceeded);
            ErrorMessages.Add(ERROR_SHARING_PAUSED, Resources.SystemErrorSharingPaused);
            ErrorMessages.Add(ERROR_SHARING_VIOLATION, Resources.SystemErrorSharingViolation);
            ErrorMessages.Add(ERROR_SHORT_NAMES_NOT_ENABLED_ON_VOLUME, Resources.SystemErrorShortNamesNotEnabledOnVolume);
            ErrorMessages.Add(ERROR_SIGNAL_PENDING, Resources.SystemErrorSignalPending);
            ErrorMessages.Add(ERROR_SIGNAL_REFUSED, Resources.SystemErrorSignalRefused);
            ErrorMessages.Add(ERROR_SUBST_TO_JOIN, Resources.SystemErrorSubstToJoin);
            ErrorMessages.Add(ERROR_SUBST_TO_SUBST, Resources.SystemErrorSubstToSubst);
            ErrorMessages.Add(ERROR_SUCCESS, Resources.SystemErrorSuccess);
            ErrorMessages.Add(ERROR_SYSTEM_TRACE, Resources.SystemErrorSystemTrace);
            ErrorMessages.Add(ERROR_THREAD_1_INACTIVE, Resources.SystemErrorThread1Inactive);
            ErrorMessages.Add(ERROR_THREAD_MODE_ALREADY_BACKGROUND, Resources.SystemErrorThreadModeAlreadyBackground);
            ErrorMessages.Add(ERROR_THREAD_MODE_NOT_BACKGROUND, Resources.SystemErrorThreadModeNotBackground);
            ErrorMessages.Add(ERROR_TOO_MANY_CMDS, Resources.SystemErrorTooManyCommands);
            ErrorMessages.Add(ERROR_TOO_MANY_MODULES, Resources.SystemErrorTooManyModules);
            ErrorMessages.Add(ERROR_TOO_MANY_MUXWAITERS, Resources.SystemErrorTooManyMutexWaiters);
            ErrorMessages.Add(ERROR_TOO_MANY_NAMES, Resources.SystemErrorTooManyNames);
            ErrorMessages.Add(ERROR_TOO_MANY_OPEN_FILES, Resources.SystemErrorTooManyOpenFiles);
            ErrorMessages.Add(ERROR_TOO_MANY_POSTS, Resources.SystemErrorTooManyPosts);
            ErrorMessages.Add(ERROR_TOO_MANY_SEM_REQUESTS, Resources.SystemErrorTooManySemaphoreRequests);
            ErrorMessages.Add(ERROR_TOO_MANY_SEMAPHORES, Resources.SystemErrorTooManySemaphores);
            ErrorMessages.Add(ERROR_TOO_MANY_SESS, Resources.SystemErrorTooManySessions);
            ErrorMessages.Add(ERROR_TOO_MANY_TCBS, Resources.SystemErrorTooManyTcbs);
            ErrorMessages.Add(ERROR_UNEXP_NET_ERR, Resources.SystemErrorUnexpectedNetworkError);
            ErrorMessages.Add(ERROR_VC_DISCONNECTED, Resources.SystemErrorVcDisconnected);
            ErrorMessages.Add(ERROR_VIRUS_DELETED, Resources.SystemErrorVirusDeleted);
            ErrorMessages.Add(ERROR_VIRUS_INFECTED, Resources.SystemErrorVirusInfected);
            ErrorMessages.Add(ERROR_WAIT_NO_CHILDREN, Resources.SystemErrorWaitNoChildren);
            ErrorMessages.Add(ERROR_WRITE_FAULT, Resources.SystemErrorWriteFault);
            ErrorMessages.Add(ERROR_WRITE_PROTECT, Resources.SystemErrorWriteProtect);
            ErrorMessages.Add(ERROR_WRONG_DISK, Resources.SystemErrorWrongDisk);
            ErrorMessages.Add(WAIT_TIMEOUT, Resources.SystemErrorWaitTimeout);

            #endregion
        }

        //public static string ToString(Int32 errorCode)
        //{
        //    String message = String.Empty;

        //    if (!ErrorMessages.TryGetValue(errorCode, out message))
        //    {
        //        message = Resources.SystemErrorUnknown;
        //    }

        //    return message;
        //}
    }
}
